#include<iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
#include <map>
using namespace std;
class Solution {
public:
    bool canJump(vector<int>& nums) {
        int now = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            if (now >= nums.size() - 1)return 1;
            if (now < i)return 0;
            now = now > i + nums[i] ? now : i + nums[i];
        }
        return 0;
    }
};